@import "../../themes/ionic.globals.wp";

// Windows Radio
// --------------------------------------------------

/// @prop - Color of the checked radio
$radio-wp-color-on:               color($colors-wp, primary) !default;

/// @prop - Color of the unchecked radio
$radio-wp-color-off:              #333 !default;

/// @prop - Order of the radio (places to the left of the item)
$radio-wp-order:                  -1 !default;

/// @prop - Width of the radio icon
$radio-wp-icon-width:             16px !default;

/// @prop - Height of the radio icon
$radio-wp-icon-height:            16px !default;

/// @prop - Border width of the radio icon
$radio-wp-icon-border-width:      2px !default;

/// @prop - Border style of the radio icon
$radio-wp-icon-border-style:      solid !default;

/// @prop - Border radius of the radio icon
$radio-wp-icon-border-radius:     50% !default;

/// @prop - Opacity of the disabled radio
$radio-wp-disabled-opacity:       .3 !default;

/// @prop - Margin of the item-left in a radio
$radio-wp-item-left-margin:       9px 20px 9px 4px !default;

/// @prop - Margin of the item-right in a radio
$radio-wp-item-right-margin:      11px 10px 10px 0 !default;


.radio-wp {
  position: relative;
  display: inline-block;
}


// Windows Radio Outer Circle: Unchecked
// -----------------------------------------

.radio-wp .radio-icon {
  position: relative;
  top: 0;
  left: 0;
  display: block;

  margin: 0;

  width: $radio-wp-icon-width;
  height: $radio-wp-icon-height;

  border-width: $radio-wp-icon-border-width;
  border-style: $radio-wp-icon-border-style;
  border-radius: $radio-wp-icon-border-radius;
  border-color: $radio-wp-color-off;
}


// Windows Radio Inner Circle: Unchecked
// -----------------------------------------

.radio-wp .radio-inner {
  position: absolute;
  top: $radio-wp-icon-border-width;
  left: $radio-wp-icon-border-width;
  display: none;

  width: $radio-wp-icon-width / 2;
  height: $radio-wp-icon-height / 2;

  border-radius: 50%;
  background-color: $radio-wp-color-off;
}


// Windows Radio Outer Circle: Checked
// -----------------------------------------

.radio-wp .radio-checked {
  border-color: $radio-wp-color-on;
}


// Windows Radio Inner Circle: Checked
// -----------------------------------------

.radio-wp .radio-checked .radio-inner {
  // transform: scale3d(1, 1, 1);
  display: block;
}


// Windows Radio: Disabled
// -----------------------------------------

.radio-wp.radio-disabled,
.item-wp.item-radio-disabled ion-label {
  opacity: $radio-wp-disabled-opacity;

  pointer-events: none;
}


// Windows Radio Within An Item
// -----------------------------------------

.item-wp .radio-wp {
  position: static;
  display: block;

  order: $radio-wp-order;

  margin: $radio-wp-item-left-margin;

  &[item-right] {
    order: 0;

    margin: $radio-wp-item-right-margin;
  }
}

.item-radio.item-wp ion-label {
  margin-left: 0;
}


// Windows Radio Color Mixin
// --------------------------------------------------

@mixin radio-theme-wp($color-name, $color-base) {

  .radio-wp-#{$color-name} .radio-checked {
    border-color: $color-base;
  }

}


// Generate Windows Radio Colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
  @include radio-theme-wp($color-name, $color-base);
}
